from django.contrib import admin
from .models import *


class BooksProfile(admin.ModelAdmin):
    list_display = [field.name for field in Book._meta.get_fields()]  # 展示所有数据
    list_per_page = 10
    search_fields = ['name']


class BorrowerProfile(admin.ModelAdmin):
    list_display = [field.name for field in Borrowed._meta.get_fields()]  # 展示所有数据
    list_per_page = 10
    search_fields = ['borrower', 'id_number']


admin.site.register(Borrowed, BorrowerProfile)
admin.site.register(Book, BooksProfile)
